package com.tjtt.gwm.service.impl;

import java.util.List;
import java.util.Map;

import com.tjtt.gwm.bean.EPInStore;
import com.tjtt.gwm.bean.EquipmentParts;
import com.tjtt.gwm.dao.EquipmentPartsDao;
import com.tjtt.gwm.service.*;
import com.tjtt.tdm.base.PageResult;
import com.tjtt.tdm.flow.bean.FlowDetailed;
import com.tjtt.tdm.flow.bean.FlowTask;
import com.tjtt.tdm.flow.bean.FlowTaskInfo;
import com.tjtt.tdm.system.bean.Organization;
import com.tjtt.tdm.system.bean.Users;

public class EquipmentPartsServiceImpl implements EquipmentPartsService {
	private EquipmentPartsDao equipmentPartsDao; 
	
	public EquipmentPartsDao getEquipmentPartsDao() {
		return equipmentPartsDao;
	}

	public void setEquipmentPartsDao(EquipmentPartsDao equipmentPartsDao) {
		this.equipmentPartsDao = equipmentPartsDao;
	}
   
	@Override
	public PageResult queryDataList(Map filterMap) {
		return equipmentPartsDao.queryDataList(filterMap);
	}
	public PageResult queryCGDataList(Map filterMap) {
		return equipmentPartsDao.queryCGDataList(filterMap);
	}
	
	public EquipmentParts queryDataById(String id){
		return equipmentPartsDao.queryDataById(id);
	}
	
	public void addepInStore(EPInStore epis){
		equipmentPartsDao.addepInStore(epis);
	}
	public void addEquipmentParts(EquipmentParts ep){
		equipmentPartsDao.addEquipmentParts(ep);
	}
	public PageResult  queryEPDataListByids(Map filterMap){
		return equipmentPartsDao.queryEPDataListByids(filterMap);
	}
	
	public EPInStore queryEPInStoreByMainId(String mainid){
		return equipmentPartsDao.queryEPInStoreByMainId(mainid);
	}
	public EPInStore  queryEPINfoByEPId(String id){
		return equipmentPartsDao.queryEPINfoByEPId(id);
	}
    //查询最大的入库单号
	public String queryMaxRKNo(){
		return equipmentPartsDao.queryMaxRKNo();
	}
	
	public EPInStore queryEPINfoByEPIdAndNo(String id){
		return equipmentPartsDao.queryEPINfoByEPIdAndNo(id);
	}
	public void updateEPINfoByEPIdAndNo(EPInStore epis){
		equipmentPartsDao.updateEPINfoByEPIdAndNo(epis);
	}
	
	public List<EPInStore> queryEPINfoByEPInNo(String instoreNo){
		return equipmentPartsDao.queryEPINfoByEPInNo(instoreNo);
	}
	
	public void updateEquipmentParts(EquipmentParts ep){
		 equipmentPartsDao.updateEquipmentParts(ep);
	}
	//删除冗余数据
	public void deleteEPInData(EPInStore ep){
		equipmentPartsDao.deleteEPInData(ep);
	}
	//根据备件id查询备件信息（其中仓库，供应商和备件以id形式存储）
	public EquipmentParts queryEPDataById(String id){
	   return 	equipmentPartsDao.queryEPDataById(id);
	}
	
	 //根据用户id查询用户姓名
	public Users queryUsersName(String id ){
		return equipmentPartsDao.queryUsersName(id);
	}
	
	//根据部门id查询部门名称
	public  Organization queryOrganizationName(String orgId){
		return equipmentPartsDao.queryOrganizationName(orgId);
	}
	
	//查询设备列表
	public PageResult queryEP(Map filterMap){
		return equipmentPartsDao.queryEP(filterMap);
	}
	//查询供应商列表
	public PageResult queryGYS(Map filterMap){
		return equipmentPartsDao.queryGYS(filterMap);
	}
	
	//获得最大的备件id
	public String queryMaxEPNo(){
		return equipmentPartsDao.queryMaxEPNo();
	}
	
	//依据备件id查询原数据（供应商、设备和部门已id形式存储）
	public EquipmentParts queryEPYuanListById(String id){
		return equipmentPartsDao.queryEPYuanListById(id);
	}
	//根据表名和对象id获取flowtaskId
    public List getFlowtaskId(String tablename,String mainid){
    	return equipmentPartsDao.getFlowtaskId(tablename, mainid);
    }
    
    // 获取FlowTaskInfo对象
    public FlowTaskInfo getFlowTaskInfo(String flowTaskId){
    	return equipmentPartsDao.getFlowTaskInfo(flowTaskId);
    }
    
     // 保存FlowTaskInfo对象
     public void updateFlowTaskInfo(FlowTaskInfo flowTaskInfo){
    	 equipmentPartsDao.updateFlowTaskInfo(flowTaskInfo);
     }
     
     //获取flowtask对象
     public FlowTask getFlowTask(String id){
    	 return equipmentPartsDao.getFlowTask(id);
     }
     
      //更新flowtask对象
     public void updateFlowTask(FlowTask f){
    	  equipmentPartsDao.updateFlowTask(f);
     }
     
	 //获取FlowDetailed对象
	public FlowDetailed getFlowDetailed(String flowTaskId){
		return equipmentPartsDao.getFlowDetailed(flowTaskId);
	}
	
	//更新FlowDetailed对象
	public void updateFlowDetailed(FlowDetailed f){
		equipmentPartsDao.updateFlowDetailed(f);
	}
	
	/**
	 * 国伟添加的
	 * @param filterMap
	 * @return
	 */
	public PageResult queryEquRelationByID(Map filterMap) {
		return equipmentPartsDao.queryEquRelationByID(filterMap);
	}
	
	// 根据sql语句查询数据
	public List queryDataBySql(String sql){
		return equipmentPartsDao.queryDataBySql(sql);
	}
}
